let weakset = new WeakSet();
class Person {
  constructor(name) {
    weakset.add(this);
    this.name = name;
  }

  running() {
    if (!weakset.has(this)) throw new Error("不能通过其他对象调用");
    console.log(this, "running");
  }
}

let kaki = new Person("kaki");
kaki.running(); //true正确调用

//错误使用
let func = kaki.running;
func();
